﻿using SCM.Common;
using SCM.Model.Enums;
using SqlSugar;
using System;

namespace SCM.Model.DBEntity
{
    /// <summary>
    /// 错误日志表
    /// </summary>
    [SugarTable("T_ErrorLog")]
    public class T_ErrorLog
    {
        /// <summary>
        /// 错误日志ID
        /// </summary>
        public string ID { get; set; }

        /// <summary>
        /// 异常信息
        /// </summary>
        public string Message { get; set; }

        /// <summary>
        /// 栈信息
        /// </summary>
        public string StackTrace { get; set; }

        /// <summary>
        /// 请求地址
        /// </summary>
        public string RequestUrl { get; set; }

        /// <summary>
        /// 客户登录IP地址
        /// </summary>
        public string ClientIP { get; set; }

        /// <summary>
        /// 操作账户
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// 来源
        /// </summary>
        public string Source { get; set; }

        /// <summary>
        /// 异常处理状态
        /// </summary>
        public ProcessFlagEnum? ProcessFlag { get; set; }

        /// <summary>
        /// 数据状态字符串
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public string ProcessFlagStr
        {
            get { return ProcessFlag.HasValue ? EnumHelper.GetDescription(ProcessFlag.Value) : ""; }
        }

        /// <summary>
        /// 报文内容
        /// </summary>
        public string RequestData { get; set; }

        /// <summary>
        /// 插入时间
        /// </summary>
        public DateTime CreateTime { get; set; }
    }
}
